3.58 \(\int \frac{\csc (e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

Optimal. Leaf size=60 \[ -\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{a f \sqrt{a-b}}-\frac{\tanh ^{-1}(\cos (e+f x))}{a f} \]

[Out]

-((Sqrt[b]*ArcTan[(Sqrt[b]*Sec[e + f*x])/Sqrt[a - b]])/(a*Sqrt[a - b]*f)) - ArcTanh[Cos[e + f*x]]/(a*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0702532, antiderivative size = 60, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3664, 391, 207, 205} \[ -\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{a f \sqrt{a-b}}-\frac{\tanh ^{-1}(\cos (e+f x))}{a f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]/(a + b*Tan[e + f*x]^2),x]

[Out]

-((Sqrt[b]*ArcTan[(Sqrt[b]*Sec[e + f*x])/Sqrt[a - b]])/(a*Sqrt[a - b]*f)) - ArcTanh[Cos[e + f*x]]/(a*f)

Rule 3664

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[((-1 + ff^2*x^2)^((m - 1)/2)*(a - b + b*ff^2*x^2)^p)/x^(
m + 1), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rule 391

Int[1/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x^n),
 x], x] - Dist[d/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\csc (e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{1}{\left (-1+x^2\right ) \left (a-b+b x^2\right )} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{a f}-\frac{b \operatorname{Subst}\left (\int \frac{1}{a-b+b x^2} \, dx,x,\sec (e+f x)\right )}{a f}\\ &=-\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{a \sqrt{a-b} f}-\frac{\tanh ^{-1}(\cos (e+f x))}{a f}\\ \end{align*}

Mathematica [B]  time = 0.205482, size = 144, normalized size = 2.4 \[ \frac{\sqrt{b} \sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{a-b}-\sqrt{a} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{b}}\right )+\sqrt{b} \sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{a-b}+\sqrt{a} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{b}}\right )-(a-b) \left (\log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )-\log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )\right )}{a f (a-b)} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]/(a + b*Tan[e + f*x]^2),x]

[Out]

(Sqrt[a - b]*Sqrt[b]*ArcTan[(Sqrt[a - b] - Sqrt[a]*Tan[(e + f*x)/2])/Sqrt[b]] + Sqrt[a - b]*Sqrt[b]*ArcTan[(Sq
rt[a - b] + Sqrt[a]*Tan[(e + f*x)/2])/Sqrt[b]] - (a - b)*(Log[Cos[(e + f*x)/2]] - Log[Sin[(e + f*x)/2]]))/(a*(
a - b)*f)

________________________________________________________________________________________

Maple [A]  time = 0.063, size = 75, normalized size = 1.3 \begin{align*} -{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ) }{2\,fa}}+{\frac{b}{fa}\arctan \left ({ \left ( a-b \right ) \cos \left ( fx+e \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}} \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}}+{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ) }{2\,fa}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)/(a+b*tan(f*x+e)^2),x)

[Out]

-1/2/f/a*ln(cos(f*x+e)+1)+1/f*b/a/(b*(a-b))^(1/2)*arctan((a-b)*cos(f*x+e)/(b*(a-b))^(1/2))+1/2/f/a*ln(cos(f*x+
e)-1)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 2.09132, size = 460, normalized size = 7.67 \begin{align*} \left [\frac{\sqrt{-\frac{b}{a - b}} \log \left (\frac{{\left (a - b\right )} \cos \left (f x + e\right )^{2} + 2 \,{\left (a - b\right )} \sqrt{-\frac{b}{a - b}} \cos \left (f x + e\right ) - b}{{\left (a - b\right )} \cos \left (f x + e\right )^{2} + b}\right ) - \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) + \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right )}{2 \, a f}, -\frac{2 \, \sqrt{\frac{b}{a - b}} \arctan \left (-\frac{{\left (a - b\right )} \sqrt{\frac{b}{a - b}} \cos \left (f x + e\right )}{b}\right ) + \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) - \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right )}{2 \, a f}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

[1/2*(sqrt(-b/(a - b))*log(((a - b)*cos(f*x + e)^2 + 2*(a - b)*sqrt(-b/(a - b))*cos(f*x + e) - b)/((a - b)*cos
(f*x + e)^2 + b)) - log(1/2*cos(f*x + e) + 1/2) + log(-1/2*cos(f*x + e) + 1/2))/(a*f), -1/2*(2*sqrt(b/(a - b))
*arctan(-(a - b)*sqrt(b/(a - b))*cos(f*x + e)/b) + log(1/2*cos(f*x + e) + 1/2) - log(-1/2*cos(f*x + e) + 1/2))
/(a*f)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc{\left (e + f x \right )}}{a + b \tan ^{2}{\left (e + f x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*tan(f*x+e)**2),x)

[Out]

Integral(csc(e + f*x)/(a + b*tan(e + f*x)**2), x)

________________________________________________________________________________________

Giac [B]  time = 1.38654, size = 149, normalized size = 2.48 \begin{align*} -\frac{\frac{2 \, b \arctan \left (-\frac{a \cos \left (f x + e\right ) - b \cos \left (f x + e\right ) - b}{\sqrt{a b - b^{2}} \cos \left (f x + e\right ) + \sqrt{a b - b^{2}}}\right )}{\sqrt{a b - b^{2}} a} - \frac{\log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}{a}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

-1/2*(2*b*arctan(-(a*cos(f*x + e) - b*cos(f*x + e) - b)/(sqrt(a*b - b^2)*cos(f*x + e) + sqrt(a*b - b^2)))/(sqr
t(a*b - b^2)*a) - log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1))/a)/f